home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr49 / 302_01.zip / DO.C < prev    next >
Text File  |  1993-04-09  |  1KB  |  38 lines

  1. /* Display object on screen
  2.  
  3.    Copyright (c) 1988 by Gus O'Donnell
  4.  
  5.    Revision history:
  6.  
  7.    Version 1.00         February 29, 1988       As released.
  8.  
  9.    Version 1.01         March 20, 1988          Created libraries for all
  10.                                                 memory models
  11.  
  12. */
  13. #include <3d.h>
  14. #include <float.h>
  15. #include <graphics.h>
  16. #include <math.h>
  17. #include <stdio.h>
  18.  
  19. void    disp_object (VECTOR lsource, int color, OBJECT *this_obj, MATRIX xfrm_mat)
  20.  
  21. /* Display an object on the screen using the current transform matrix.
  22.  
  23. The shades of the faces are determined by the angle between the light source,
  24. lsource, and the normal to the face.  The displayed shade is proportional
  25. to the cosine of this angle. */
  26.  
  27. {
  28.     FACE *fhandle;                      /* Pointer for traversing the face
  29.                                            list */
  30.  
  31.     fhandle = this_obj -> faces -> next;
  32.     while ((fhandle -> next) != NULL)
  33.     {
  34.         disp_face (lsource, color, fhandle, xfrm_mat);
  35.         fhandle = fhandle -> next;
  36.     }
  37. }
  38.